package command;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

import json.Mapper;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.core.JsonProcessingException;

import controller.ApplicationController;

@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class StatechartCommand implements Command {

	@Override
	public abstract void executeLocal(ApplicationController applicationController);
	
	@Override
	public abstract void executeRemote(ApplicationController applicationController);
	
	@Override
	public String getContentAsString() throws JsonProcessingException {
		return Mapper.getObjectMapper().writeValueAsString(this);
	}

}
